﻿<UserControl x:Class="DiscoveryLogic.Analytics.Modules.Clusters.ClusterNetworkEditor"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="Auto" Width="400" Loaded="UserControl_Loaded">
    <Grid Margin="10">
        <DockPanel LastChildFill="True">
            <GroupBox Header="Field clustering" DockPanel.Dock="Top">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="30"/>
                        <RowDefinition Height="60"/>
                        <RowDefinition Height="30"/>
                    </Grid.RowDefinitions>

                    <Label
                        Grid.Row="0" Grid.Column="0"
                        Margin="5,0,0,0" VerticalAlignment="Center">Entity:</Label>
                    <ComboBox
                        Grid.Row="0" Grid.Column="1" x:Name="cboEntityType"
                        Margin="5,0,5,0" VerticalAlignment="Center" SelectionChanged="cboEntityType_SelectionChanged" />

                    <Label
                        Grid.Row="1" Grid.Column="0"
                        Margin="5,0,0,0" VerticalAlignment="Center">Cluster rule</Label>
                    <ComboBox
                        Grid.Row="1" Grid.Column="1" x:Name="cboClusterRule"
                        Margin="5,0,5,0" VerticalAlignment="Center"/>

                    <StackPanel
                        Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
                        Orientation="Horizontal" Margin="5,2,5,2"
                        VerticalAlignment="Center" HorizontalAlignment="Right">
                        <Button 
                            x:Name="btnAddEntityClusterRule" 
                            Content="Add cluster rule" Width="180" Margin="5,0,0,0" Click="btnOK1_Click" />
                    </StackPanel>
                    
                    <ListBox
                        Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
                        x:Name="lbEntityClusterRules" Margin="5,0,5,0"/>
                    
                    <StackPanel
                        Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2"
                        Orientation="Horizontal" Margin="5,2,5,2"
                        VerticalAlignment="Center" HorizontalAlignment="Right">
                        <Button 
                            x:Name="btnRemoveEntityClusterRule" 
                            Content="Remove selected cluster rule" 
                            Width="180" Margin="5,0,0,0" Click="btnRemoveEntityClusterRule_Click" />
                    </StackPanel>
                </Grid>
            </GroupBox>
            
            <GroupBox Header="Density clustering">
                <StackPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal" Margin="5">
                        <Label Margin="0,0,5,0">Density threshold:</Label>
                        <Slider 
                            x:Name="sliderThreshold" SmallChange="0.1" LargeChange="1"
                            Orientation="Horizontal" Maximum="1000" Minimum="1" Value="20" Width="125" ValueChanged="Slider_ValueChanged" />
                        <Label x:Name="lblThreshold" Margin="5,0,0,0" Content="{Binding ElementName=sliderThreshold, Path=Value, StringFormat=F1}"/>
                        
                    </StackPanel>
                    <StackPanel
                        Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
                        Orientation="Horizontal" Margin="5,2,5,2"
                        VerticalAlignment="Center" HorizontalAlignment="Right">
                        <Button x:Name="btnOK2" Content="OK" Width="50" Margin="5,0,0,0" Click="btnOK2_Click" />
                    </StackPanel>
                </StackPanel>
            </GroupBox>
        </DockPanel>
    </Grid>
</UserControl>
